<div class="center">
	<div class="home">
        <div class="home_left">
            <?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
        <div class="home_right">
        
        
            <div class="shezhi">
            	<h1><i></i>用户投诉</h1>
            </div>
            
            <div class="shezhinav">
                <ul>
                    <li class="shezhion"><a href="/member/complain"><i class="shezhi1"></i>我要投诉</a></li>
                </ul>
            </div>
        <form id="form1" method="post">
    	
      
    		<div class="mimatishi">
            	<h1>如果您觉得悠奇的服务不够满意或者有更好的建议</h1>
                <h1>请您留下宝贵的建议，以便悠奇以后更好的为会员服务</h1>
            </div>
            <div class="mimatable">
            	<table>
                	<tr>
                            <td class="mz" style="width:112px;"><span>*</span>投诉标题：</td>
                            <td><input type="text" name="title" id="input_title" style="width:480px;"><p id="div_input_title" style="display:none;"><i></i>标题不能为空</p></td>
                        </tr>
                        <tr>
                            <td class="mz" style="width:112px;"><span>*</span>投诉内容：</td>
                            <td><textarea cols="68" rows="10" id="input_content"></textarea></td>
                        </tr>
                        <tr id="div_input_content" style="display:none;">
                            <td class="mz" style="width:112px;">&nbsp;</td>
                            <td><p><i></i>内容不能为空</p></td>
                        </tr>
                </table>
                
                <div class="mimatijiao">
                	<a href="javascript:complaint()"><span>提交投诉</span></a>
                </div>
                
            </div>

        </form>


        </div>
        

    </div>
</div>

<script type="text/javascript">
    function complaint(){
        var userId = <?php echo $this->user->Id; ?>;
        var title = $('#input_title').val();
        var content = $('#input_content').val();
        if(title.length < 1){
            $('#div_input_title').show();            
            return false;
        }
        if(content.length < 1){
            $('#div_input_title').hide();
            $('#div_input_content').show();
            return false;
        }
        $('#div_input_title').hide();
        $('#div_input_content').hide();
        $.post(
            '/member/complaints',
            {'userId':userId,'title':title,'content':content},
            function (data){
                if(data === 1){
                    $('.mimatijiao').html("<font size='4' color='green'>您的投诉已提交，我们会在短时间内给您答复</font>");
                }else{
                    $('.mimatijiao').html("<font size='4' color='red'>您的请求过于频繁…………</font>");
                }
            }
        );
    }
</script>